// JavaScript Document

/*close关闭*/


/*table切换（index_cooperation）*/
function word(a){
	for(t=1;t<=2;t++){
	document.getElementById("content"+t).style.display="none"
	document.getElementById("c"+t).className=""
	}
	document.getElementById("content"+a).style.display="block"
	document.getElementById("c"+a).className="hover"
}


/*table切换（index_purchase）*/
function _word(a){
	for(t=1;t<=4;t++){
	document.getElementById("wenzi"+t).style.display="none"
	document.getElementById("b"+t).className=""
	}
	document.getElementById("wenzi"+a).style.display="block"
	document.getElementById("b"+a).className="hover"
}


/*table切换*/
function setTab(name,cursel,n){

	for (var i = 1;i <= n ;i++ ){
		var oMenu = document.getElementById(name+i);
		var oCon = document.getElementById('con_'+name+'_'+i);
		oMenu.className = i == cursel?'hover':'';
		oCon.className = i == cursel?'current':'undis';
	}
  }


/*index   nav*/
$(document).ready(function() {
	
	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);

});



/*company*/
//Tab面板函数
function create_tab_box(tab_list,hover,tab_box){	
	jQuery('#'+tab_box+' > div:gt(0)').hide();	
	var $div_li =jQuery('#'+tab_list+' li');
	$div_li.mouseover(function(){
	jQuery(this).addClass(hover).siblings().removeClass(hover);
	var index =  $div_li.index(this);
	jQuery('#'+tab_box+' > div').eq(index).show().siblings().hide();
	});
}
create_tab_box('big_box','on','mb-right')



 //Tab面板函数
function nTabs(thisObj, Num) {
            if (thisObj.className == "active") return;
            var tabList = document.getElementById("myTab").getElementsByTagName("li");
            for (i = 0; i < tabList.length; i++) {
                if (i == Num) {
                    thisObj.className = "active";
                    document.getElementById("myTab_Content" + i).style.display = "block";
                } else {
                    tabList[i].className = "normal";
                    document.getElementById("myTab_Content" + i).style.display = "none";
                }
            }
        }
		
lastScrollY=0;








